package com.xbongbong.process.ding;

import com.xbongbong.paas.pojo.dto.PaasFormDataEsInitDTO;
import com.xbongbong.paas.pojo.vo.PaasFormDataEsInitVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.enums.workrecord.enums.WorkrecordResultEnum;
import com.xbongbong.pro.process.pojo.dto.WorkrecordInstanceDTO;
import com.xbongbong.pro.process.pojo.dto.WorkrecordTaskDTO;
import com.xbongbong.pro.process.pojo.dto.WorkrecordUpdateTaskDTO;

/**
 * 钉钉待办
 * @author xingxing.xiao
 * @date 2019/08/02 19:59
 */
public interface DingtalkWorkrecordService {

    /**
     * 获取待办配置
     * @param corpid
     */
    String getCompanyWorkrecordProcessCode(String corpid);

    /**
     * 创建钉钉待办实例
     * @param workrecordInstanceDTO
     */
    void createWorkrecordInstance(WorkrecordInstanceDTO workrecordInstanceDTO);

    /**
     * 更新实例状态(通过/拒绝)
     * @param corpid
     * @param processInstanceId
     * @param workrecordResultEnum
     */
    boolean updateWorkrecordInstance(String corpid, String processInstanceId, WorkrecordResultEnum workrecordResultEnum);

    /**
     * 删除钉钉待办实例
     * @param corpid
     * @param processInstanceId
     */
    boolean deleteWorkrecordInstance(String corpid, String processInstanceId);

    /**
     * 创建钉钉待办任务
     * @param workrecordTaskDTO
     */
    void createWorkrecordTask(WorkrecordTaskDTO workrecordTaskDTO);

    /**
     * 更新单个任务状态(同意/拒绝)
     * @param workrecordUpdateTaskDTO
     * @param workrecordResultEnum
     */
    boolean updateSingleWorkrecordTask(WorkrecordUpdateTaskDTO workrecordUpdateTaskDTO, WorkrecordResultEnum workrecordResultEnum);

    /**
     * 批量取消任务
     * @param workrecordUpdateTaskDTO
     */
    boolean cancelWorkrecordTaskgroup(WorkrecordUpdateTaskDTO workrecordUpdateTaskDTO);

    /**
     * 删除钉钉模板
     * @param corpid
     * @param processCode
     */
    boolean delPorcessTemplate(String corpid, String processCode);

    /**
     * 删除单个公司es所有的数据(搬的鲁江的代码)
     * @param paasFormDataEsInitDTO
     * @return
     * @throws XbbException
     */
    @Deprecated
    PaasFormDataEsInitVO deleteAllData(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;

}
